package com.example.demomybatis.controller;

import com.example.demomybatis.entity.User;
import com.example.demomybatis.service.UserService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName  UserController
 * @Description 用户控制器
 * @Author leejiliang
 * @DateTime 2020/8/31 1:19 PM
 * @Version 1.0
 */
@RestController
@RequestMapping("/users")
@AllArgsConstructor
public class UserController {
	private final UserService userService;

	@GetMapping
	public List<User> getUsers() {
		return userService.getUsers();
	}
}
